package com.cloud.security.core.security;


import com.cloud.admin.beans.dto.UserDTO;
import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

/**
 * UserDetails 配置
 * @author Aijm
 * @since 2019/6/9
 */
@Data
public class SecurityUser extends User {

	/**
	 * 配置租户信息
	 */
	private String tenantId;

	public SecurityUser(String username, String password, Collection<? extends GrantedAuthority> authorities) {
		super(username, password, authorities);
	}

	public SecurityUser(String username, String password, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities) {
		super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
	}

	public SecurityUser(String username, String password, Collection<? extends GrantedAuthority> authorities, String tenantId) {
		super(username, password, authorities);
		this.tenantId = tenantId;
	}
}
